<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>WLog: ILevel.h源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- 制作者 Doxygen 1.5.8 -->
<script type="text/javascript">
<!--
function changeDisplayState (e){
  var num=this.id.replace(/[^[0-9]/g,'');
  var button=this.firstChild;
  var sectionDiv=document.getElementById('dynsection'+num);
  if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){
    sectionDiv.style.display='block';
    button.src='open.gif';
  }else{
    sectionDiv.style.display='none';
    button.src='closed.gif';
  }
}
function initDynSections(){
  var divs=document.getElementsByTagName('div');
  var sectionCounter=1;
  for(var i=0;i<divs.length-1;i++){
    if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){
      var header=divs[i];
      var section=divs[i+1];
      var button=header.firstChild;
      if (button!='IMG'){
        divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild);
        button=document.createElement('img');
        divs[i].insertBefore(button,divs[i].firstChild);
      }
      header.style.cursor='pointer';
      header.onclick=changeDisplayState;
      header.id='dynheader'+sectionCounter;
      button.src='closed.gif';
      section.id='dynsection'+sectionCounter;
      section.style.display='none';
      section.style.marginLeft='14px';
      sectionCounter++;
    }
  }
}
window.onload = initDynSections;
-->
</script>
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>首页</span></a></li>
      <li><a href="namespaces.html"><span>名字空间</span></a></li>
      <li><a href="annotated.html"><span>类</span></a></li>
      <li class="current"><a href="files.html"><span>文件</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>文件列表</span></a></li>
      <li><a href="globals.html"><span>文件成员</span></a></li>
    </ul>
  </div>
<h1>ILevel.h</h1><a href="ILevel_8h.html">浏览该文件的文档。</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef _WLOG_ILEVEL_H_</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define _WLOG_ILEVEL_H_</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a>00004 <span class="preprocessor">#include &lt;string&gt;</span>
<a name="l00005"></a>00005 
<a name="l00006"></a>00006 <span class="preprocessor">#include "<a class="code" href="Record_8h.html">Record.h</a>"</span>
<a name="l00007"></a>00007 
<a name="l00008"></a>00008 <span class="keyword">using</span> std::string;
<a name="l00009"></a>00009 
<a name="l00010"></a>00010 <span class="keyword">namespace </span>WLog
<a name="l00011"></a>00011 {
<a name="l00012"></a><a class="code" href="ILevel_8h.html#0dd54d262b6f14f4bc391a308ed13a7f">00012</a> <span class="preprocessor">    #define OUT_NAME        (0x1 &lt;&lt; 0)</span>
<a name="l00013"></a><a class="code" href="ILevel_8h.html#f23118c73adabada3de7341a278b9771">00013</a> <span class="preprocessor"></span><span class="preprocessor">    #define OUT_DSCRP       (0x1 &lt;&lt; 1)</span>
<a name="l00014"></a><a class="code" href="ILevel_8h.html#4f175ae46d9e17de3260cc4f76e75177">00014</a> <span class="preprocessor"></span><span class="preprocessor">    #define OUT_LINENO      (0x1 &lt;&lt; 2)</span>
<a name="l00015"></a><a class="code" href="ILevel_8h.html#1940b107d0fdbf0dc6bb29b2c2c828a9">00015</a> <span class="preprocessor"></span><span class="preprocessor">    #define OUT_FUNCNAME    (0x1 &lt;&lt; 3)</span>
<a name="l00016"></a><a class="code" href="ILevel_8h.html#8a1cb3712bd7a21dd934f2d46e3d5021">00016</a> <span class="preprocessor"></span><span class="preprocessor">    #define OUT_FILENAME    (0x1 &lt;&lt; 4)</span>
<a name="l00017"></a><a class="code" href="ILevel_8h.html#c3429870eb853c3b46e43b7687c5fb75">00017</a> <span class="preprocessor"></span><span class="preprocessor">    #define OUT_TIME        (0x1 &lt;&lt; 5)</span>
<a name="l00018"></a><a class="code" href="ILevel_8h.html#86e5a01783a27ce4b5b999ecc85de9ee">00018</a> <span class="preprocessor"></span><span class="preprocessor">    #define OUT_NEWLINE     (0x1 &lt;&lt; 6)</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span>    
<a name="l00020"></a><a class="code" href="ILevel_8h.html#5fd2c751ba03efcdc0f6eaadbe175c9a">00020</a> <span class="preprocessor">    #define SIGNED_OUT_ALL          (OUT_NAME|OUT_DSCRP|OUT_LINENO|OUT_FUNCNAME|OUT_FILENAME|OUT_TIME|OUT_NEWLINE)</span>
<a name="l00021"></a><a class="code" href="ILevel_8h.html#5642599debe6e90af72366d09c118c01">00021</a> <span class="preprocessor"></span><span class="preprocessor">    #define SIGNED_OUT_NONE         (0)</span>
<a name="l00022"></a><a class="code" href="ILevel_8h.html#3c3835bbb2393e0c43ef1cd88c70edb3">00022</a> <span class="preprocessor"></span><span class="preprocessor">    #define SIGNED_OUT_NO_FILE_NAME (OUT_NAME|OUT_DSCRP|OUT_LINENO|OUT_FUNCNAME|OUT_TIME|OUT_NEWLINE)</span>
<a name="l00023"></a>00023 <span class="preprocessor"></span>    
<a name="l00024"></a><a class="code" href="ILevel_8h.html#b744fc9817e3580fae60b2b5d6838261">00024</a> <span class="preprocessor">    #define SIGNED_GET_BOOL(sign, which) (0 != (sign &amp; which)) </span>
<a name="l00025"></a>00025 <span class="preprocessor"></span>    
<a name="l00026"></a>00026     <span class="keyword">class </span>IOuter;
<a name="l00027"></a><a class="code" href="namespaceWLog.html#fc8bd5f12f250893cf48c07b699a247d">00027</a>     <span class="keyword">typedef</span> bool (*<a class="code" href="namespaceWLog.html#fc8bd5f12f250893cf48c07b699a247d">FunCallBack</a>)(<a class="code" href="classWLog_1_1Record.html" title="记录类，记录一条信息的所有字段。">Record</a>*, <a class="code" href="classWLog_1_1IOuter.html" title="Interface for output Record with define Log Level.">IOuter</a>*);
<a name="l00028"></a>00028     
<a name="l00029"></a>00029     <span class="keywordtype">bool</span> <a class="code" href="namespaceWLog.html#6315f1351a7f92cf5bb70536413cb0da">cb_trimFileName</a>(<a class="code" href="classWLog_1_1Record.html" title="记录类，记录一条信息的所有字段。">Record</a>* pRecord, <a class="code" href="classWLog_1_1IOuter.html" title="Interface for output Record with define Log Level.">IOuter</a>* pOuter);
<a name="l00030"></a>00030     <span class="keywordtype">bool</span> <a class="code" href="namespaceWLog.html#9ceab8f8dc49e6ae5886332c430b3573">cb_exit</a>(<a class="code" href="classWLog_1_1Record.html" title="记录类，记录一条信息的所有字段。">Record</a>* pRecord, <a class="code" href="classWLog_1_1IOuter.html" title="Interface for output Record with define Log Level.">IOuter</a>* pOuter);
<a name="l00031"></a>00031     <span class="keywordtype">bool</span> <a class="code" href="namespaceWLog.html#05e19038a875320b3c71790d92a282cf">cb_assert</a>(<a class="code" href="classWLog_1_1Record.html" title="记录类，记录一条信息的所有字段。">Record</a>* pRecord, <a class="code" href="classWLog_1_1IOuter.html" title="Interface for output Record with define Log Level.">IOuter</a>* pOuter);
<a name="l00037"></a><a class="code" href="classWLog_1_1ILevel.html">00037</a>     <span class="keyword">class </span><a class="code" href="classWLog_1_1ILevel.html" title="Define Interface for Log Level.">ILevel</a> 
<a name="l00038"></a>00038     {
<a name="l00039"></a>00039     <span class="keyword">public</span>: 
<a name="l00040"></a>00040         <a class="code" href="classWLog_1_1ILevel.html#0188823b552c9a59be13aff007353b3f">ILevel</a>(<span class="keywordtype">int</span> iLevel, <span class="keyword">const</span> <span class="keywordtype">char</span>* szName, <span class="keyword">const</span> <span class="keywordtype">char</span>* szDscrp, <span class="keywordtype">int</span> iSigned = <a class="code" href="ILevel_8h.html#5fd2c751ba03efcdc0f6eaadbe175c9a">SIGNED_OUT_ALL</a>, <a class="code" href="namespaceWLog.html#fc8bd5f12f250893cf48c07b699a247d">FunCallBack</a> cbBefore = <a class="code" href="namespaceWLog.html#6315f1351a7f92cf5bb70536413cb0da">cb_trimFileName</a>, <a class="code" href="namespaceWLog.html#fc8bd5f12f250893cf48c07b699a247d">FunCallBack</a> cbAfter = 0);
<a name="l00041"></a>00041 
<a name="l00042"></a>00042         <span class="keyword">virtual</span> <a class="code" href="classWLog_1_1ILevel.html#5b35f47cff2006f78a3f141979940eeb">~ILevel</a>();
<a name="l00043"></a>00043 
<a name="l00044"></a>00044     <span class="keyword">public</span>: <span class="comment">//interface</span>
<a name="l00051"></a>00051 <span class="comment"></span>        <span class="keywordtype">int</span> <a class="code" href="classWLog_1_1ILevel.html#652b09fa23f53092827c789330c53095" title="得到当前Log定义的级别.">getLevel</a>() <span class="keyword">const</span>;
<a name="l00052"></a>00052         
<a name="l00059"></a>00059         <span class="keywordtype">string</span> <a class="code" href="classWLog_1_1ILevel.html#4e06cea4bbd31aae2a9170b24e7d6657" title="得到当前Log的名称.">getName</a>() <span class="keyword">const</span>;
<a name="l00060"></a>00060         
<a name="l00067"></a>00067         <span class="keywordtype">string</span> <a class="code" href="classWLog_1_1ILevel.html#7b8ce7477e0e4c646ac286d48aa2d2e4" title="得到当前Log的描述.">getDscrp</a>() <span class="keyword">const</span>;
<a name="l00068"></a>00068 
<a name="l00075"></a>00075         <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classWLog_1_1ILevel.html#c5ee0c8e7bd470d233535d45655d889e" title="是否要输出“名称”">bOutName</a>() <span class="keyword">const</span>;
<a name="l00076"></a>00076 
<a name="l00083"></a>00083         <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classWLog_1_1ILevel.html#d436d736b300882a450926b59cd9c546" title="是否要输出“描述”">bOutDscrp</a>() <span class="keyword">const</span>;
<a name="l00084"></a>00084 
<a name="l00091"></a>00091         <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classWLog_1_1ILevel.html#fdc93101a0cba201cf5dcdf6183a74a2" title="是否要输出“行号”">bOutLineNo</a>() <span class="keyword">const</span>;
<a name="l00092"></a>00092 
<a name="l00099"></a>00099         <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classWLog_1_1ILevel.html#1f6651825c0af325a2f909b12b8857de" title="是否要输出“方法名”">bOutFuncName</a>() <span class="keyword">const</span>;
<a name="l00100"></a>00100 
<a name="l00107"></a>00107         <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classWLog_1_1ILevel.html#83164649d0ca90645038df2e05f1843a" title="是否要输出“文件名”">bOutFileName</a>() <span class="keyword">const</span>;
<a name="l00108"></a>00108 
<a name="l00115"></a>00115         <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classWLog_1_1ILevel.html#86121504cef5e39ec3425376dd10ceeb" title="是否要输出“日志记录时间”">bOutTime</a>() <span class="keyword">const</span>;
<a name="l00116"></a>00116 
<a name="l00123"></a>00123         <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classWLog_1_1ILevel.html#4c1def9de4e28f9a29a02dead8824a9f" title="是否在消息输出后输出“新行”">bNewLine</a>() <span class="keyword">const</span>;
<a name="l00124"></a>00124         
<a name="l00131"></a>00131         <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classWLog_1_1ILevel.html#ff3a60a5f597e84874c9f95adc34100e" title="回调函数，在输出后调用，对此级别Log作善后处理.">callBack_AfterOut</a>(<a class="code" href="classWLog_1_1Record.html" title="记录类，记录一条信息的所有字段。">Record</a>* pRecord, <a class="code" href="classWLog_1_1IOuter.html" title="Interface for output Record with define Log Level.">IOuter</a>* pOuter);
<a name="l00132"></a>00132         
<a name="l00139"></a>00139         <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classWLog_1_1ILevel.html#995896554a53b1e03c0617a36d3b3afc" title="回调函数，在输出前调用，对此级别Log Record 提前处理.">callBack_BeforeOut</a>(<a class="code" href="classWLog_1_1Record.html" title="记录类，记录一条信息的所有字段。">Record</a>* pRecord, <a class="code" href="classWLog_1_1IOuter.html" title="Interface for output Record with define Log Level.">IOuter</a>* pOuter);
<a name="l00140"></a>00140         
<a name="l00141"></a>00141     <span class="keyword">private</span>:
<a name="l00142"></a>00142         <span class="keywordtype">int</span> m_iLevel;
<a name="l00143"></a>00143         <span class="keywordtype">string</span> m_strName;
<a name="l00144"></a>00144         <span class="keywordtype">string</span> m_strDscrp;
<a name="l00145"></a>00145         <span class="keywordtype">int</span> m_iSign;        
<a name="l00146"></a>00146         <a class="code" href="namespaceWLog.html#fc8bd5f12f250893cf48c07b699a247d">FunCallBack</a> m_callBackBefore;
<a name="l00147"></a>00147         <a class="code" href="namespaceWLog.html#fc8bd5f12f250893cf48c07b699a247d">FunCallBack</a> m_callBackAfter;
<a name="l00148"></a>00148     };
<a name="l00149"></a>00149 
<a name="l00150"></a>00150 }
<a name="l00151"></a>00151 <span class="preprocessor">#endif //_WLOG_ILEVEL_H_</span>
</pre></div></div>
<hr>
<address style="align: right;">
  Generated on Mon Apr 6 21:08:12 2009 for WLog by 韦体东<img src="logo.png" align="middle"/></address>
</body>
</html>
